#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include "tiledesignerscene.h"
#include "tileselectscene.h"

class QGraphicsView;
class QMenu;
class QToolBox;
class QHBoxLayout;
class QVBoxLayout;
class QListWidget;
class QPushButton;
class QListWidgetItem;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    QHBoxLayout *layout;
    QVBoxLayout *layout1;
    QHBoxLayout *layout2;

    TileDesignerScene *scene;
    TileSelectScene *selectScene;
    QGraphicsView *view;
    QGraphicsView *selectView;
    QToolBox *toolBox;
    QMenu *fileMenu;
    QAction *fileNewAction;
    QAction *fileExportAction;
    QWidget *layersWidget;
    QListWidget *layersList;
    QPushButton *addLayer;
    QPushButton *deleteLayer;
    QListWidgetItem *backgroundItem;

    bool ready;
    bool changed;

    void setWidgets();
    void createMenus();
    void addToolBoxStuff();
    void selectLayer(qint16 id);

private slots:
    void onFileNewClicked();
    void onFileExportClicked();
    void onSelectedTileChanged(qint32 tileNum);
    void onAddLayerClicked();
    void onDeleteLayerClicked();
    void onLayersListCurrentRowChanged(int row);
    void onLayersListItemChanged(QListWidgetItem* item);
};

#endif // MAINWINDOW_H
